package com.kfm.servlet;

import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;

@WebServlet("/generic")
// 继承GenericServlet 抽象类 重写 service() 抽象方法
public class FourthServlet extends GenericServlet {

    @Override
    public void init() {
        System.out.println("初始化");
    }

    @Override
    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
        // 当前servlet要如何处理业务
        System.out.println("FourthServlet 提供服务");
    }
}
